res->_valid = ok;
}
-static bool deleteBatch(SqlQuery &query, const QStringList &entries, const QString &name)
+static bool deleteBatch(SqlQuery &query, const QStringList &entries)
{
if (entries.isEmpty())
return true;
- qCDebug(lcDb) << "Removing stale" << name << "entries:" << entries.join(QStringLiteral(", "));
- // FIXME: Was ported from execBatch, check if correct!
for (const auto &entry : entries) {
query.reset_and_clear_bindings();
query.bindValue(1, entry);
qCDebug(lcDb) << "database error:" << query->error();
return empty_result;
}
- if (!deleteBatch(*query, superfluousPaths, QStringLiteral("downloadinfo"))) {
+ if (!deleteBatch(*query, superfluousPaths)) {
return empty_result;
}
}
}
const auto deleteUploadInfoQuery = _queryManager.get(PreparedSqlQueryManager::DeleteUploadInfoQuery);
- deleteBatch(*deleteUploadInfoQuery, superfluousPaths, QStringLiteral("uploadinfo"));
+ deleteBatch(*deleteUploadInfoQuery, superfluousPaths);
return ids;
}
SqlQuery delQuery(_db);
delQuery.prepare("DELETE FROM blacklist WHERE path = ?");
- return deleteBatch(delQuery, superfluousPaths, QStringLiteral("blacklist"));
+ return deleteBatch(delQuery, superfluousPaths);
}
void SyncJournalDb::deleteStaleFlagsEntries()
_lockedFiles.insert(checkResult.path);
}
- qCDebug(lcFolderWatcher) << "Locked files:" << _lockedFiles.values();
-
// ------- handle ignores:
if (pathIsIgnored(path)) {
continue;
changedPaths.insert(path);
}
- qCDebug(lcFolderWatcher) << "Unlocked files:" << _unlockedFiles.values();
- qCDebug(lcFolderWatcher) << "Locked files:" << _lockedFiles;
-
if (!_lockedFiles.isEmpty() || !_unlockedFiles.isEmpty()) {
if (_lockChangeDebouncingTimer.isActive()) {
_lockChangeDebouncingTimer.stop();
_journal->getAndDeleteStaleDownloadInfos(download_file_paths);
for (const SyncJournalDb::DownloadInfo &deleted_info : deleted_infos) {
const QString tmppath = _propagator->fullLocalPath(deleted_info._tmpfile);
- qCInfo(lcEngine) << "Deleting stale temporary file: " << tmppath;
FileSystem::remove(tmppath);
}
}